{namespace rb.browse.templates}


/**
 * Set up the browsing UI.
 * @param posts An array of objects with "title", "author", "created", and
 *    "slug" properties.
 */
{template .browseUI}
  <h3>Browse Posts</h3>
  
  <table width="100%">
    <tr class="browse-list-entry browse-list-head">
      <td class="browse-list-title">
        <b>Blog Post Title</b>
        <br />
        Posting date
      </td>
      <td class="browse-list-author">
        <b>Author</b>
      </td>
    </tr>

  {foreach $post in $posts}
    {call .post}
      {param post: $post /}
    {/call}
  {/foreach}
  </table>
  
{/template}


/**
 * Create a single post in the list of posts.
 * @param post An object with "title", "created", "slug", "authorName", and
 *    "authorTitle" properties.
 */
{template .post}
<tr id="browse-list-entry-{$post.slug|id}" class="browse-list-entry">
  <td class="browse-list-title">
    <b>{$post.title}</b>
    <br />
    {$post.created}
  </td>
  <td class="browse-list-author">
    <b>{$post.authorName}</b>
    <br />
    {$post.authorTitle}
  </td>
</tr>
{/template}
